Improve implementation of 'forward-thing' using custom providers
authorJim Porter <jporterbugs@gmail.com>
Mon, 20 May 2024 19:37:22 +0000 (12:37 -0700)
committerJim Porter <jporterbugs@gmail.com>
Mon, 20 May 2024 20:24:11 +0000 (13:24 -0700)
commitf6c60f16a231802104f53f3953b7fdc363944316
tree6a7ae5bf39f3651fd08ed1aeb9d4455addcd8847
parent642fd607b83c56847914a8a46d6c297a74529610
Improve implementation of 'forward-thing' using custom providers

Now, call all the custom providers for each step, using the provider
that moves point the smallest non-zero amount.  This allows multiple
providers for a given "thing" to work nicely together.

* lisp/thingatpt.el (forward-thing-provider-alist): Update docstring.
(forward-thing): New implementation to call each provider N times.
(forward-thing-for-text-property): Take BACKWARD instead of N.  Update
callers.

* test/lisp/thingatpt-tests.el (thing-at-point-providers)
(forward-thing-providers): Add more checks.
(consecutive-things-at-point): New test.
lisp/net/eww.el
lisp/progmodes/bug-reference.el
lisp/thingatpt.el
test/lisp/thingatpt-tests.el